<?php
namespace Dry\Base;

class Config {

    private $appRoot = '';

    public function __construct($appRoot)
    {
        $this->appRoot = $appRoot;
    }

    public function get($name)
    {
        $file = $this->appRoot."/app/config/{$name}.php";
        if(is_file($file)){
            return require($file);
        }
        else{
            return array();
        }
    }

    public function read($vendor, $dir, $name)
    {
        $file = $this->appRoot."/src/{$vendor}/{$dir}/config/{$name}.php";
        if(is_file($file)){
            return require($file);
        }
        else{
            return array();
        }
    }

}
?>
